Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources StorageNodeSet and DatabaseNodeSet #169

Merged
merged 41 commits into from
Jan 24, 2024

Conversation

kobzonega
Copy link
Contributor

@kobzonega kobzonega commented Dec 14, 2023

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Storage/Database CR creates one StatefulSet k8s object which operated pods with YDB processes.

Issue Number: YDBOPS-8645, YDBOPS-8646

What is the new behavior?

  • We propose new CRDs (Custom Resource Definitions) named StorageNodeSet and DatabaseNodeSet, which define the parameters of StatefulSets for a specific logical group of YDB nodes. The creation and modification of objects occur through the definition in the Storage/Database object, specifying parameters in the spec.nodeSet field. Thus controller used in the ydb-operator performs the CRUD operation for *NodeSet CustomResource objects automatically.

  • Performing Reconcile for NodeSet objects should include checking the presence of the StatefulSet resource, matching the desired quantity of replicas with the observed quantity. The status of parent objects when using *NodeSet is determined as the composition of readiness statuses StatefulSet and child Pod objects.

  • Operations related to interaction with the YDB cluster, such as Storage initialization, Tenant creation, SelfCheck verification, are performed in the Reconcile process for the Storage/Database object. For this purpose, in the parameters of StatefulSet objects created using NodeSet, the spec.serviceName (within one parent object) must be specified identically.

Other information

Additional refactoring:

  • Update Makefile test scenarios to use existing kind cluster

  • Use new const variables GRPCServiceFQDNFormat and InterconnectServiceFQDNFormat to build URL endpoint and domain strings

  • Edit const variable DefaultDatabaseDomain value from "root" to "Root"

  • Remove database_defaults.go as useless (same logic as in kubebuilder webhook.Defaulter interface)

  • Use type NamespacedRef for StorageClusterRef and DatabaseRef fields in CustomResources

  • Add new field StorageEndpoint to Database and DatabaseNodeSet objects spec to define external FQDN for --node-broker container arg

  • Remove useless PublicHost field in Database CR (use .spec.Service.GRPC.ExternalHost and .spec.Service.Interconnect.ExternalHost instead)

  • Move YDB configuration build logic to a webhook so that it can be generated and specified when ydb-operator mutating API objects

@kobzonega kobzonega changed the title Ydbops 8646 Resources StorageNodeSet and DatabaseNodeSet Dec 14, 2023
@kobzonega kobzonega force-pushed the YDBOPS-8646 branch 12 times, most recently from 858c4de to 94d65df Compare January 22, 2024 08:30
@kobzonega kobzonega force-pushed the YDBOPS-8646 branch 2 times, most recently from d887fe7 to 720e1a1 Compare January 22, 2024 08:59
@kobzonega kobzonega merged commit 9ae6d37 into ydb-platform:master Jan 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants